import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutterroom/pages/home/tab_index/index_recommond_item_widget.dart';
import 'index_recommond_data.dart';

class IndexRecommnd extends StatelessWidget {
  final List<IndexRecommendItem> dataList;

  const IndexRecommnd({Key key, this.dataList=indexRecommendData}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(10),
      decoration: BoxDecoration(color: Color(0x08000000)),
      child: Column(
        children: <Widget>[
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[ Text("房屋推荐",style: TextStyle(color: Colors.black,fontWeight:FontWeight.w500),), Text("更多",style: TextStyle(color: Colors.black45),)],
          ),
          Padding(padding: EdgeInsets.all(5)),
          Wrap(
              runSpacing: 10.0,
              spacing: 10,
              children: dataList
                  .map((item) => IndexRecommondItemWidget(data: item))
                  .toList()),
        ],
      ),
    );
  }
}
